// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   InstituteProfileService.java

package com.nervytech.tutorcruise.db.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.nervytech.tutorcruise.db.dao.interfaces.IInstituteProfileDAO;
import com.nervytech.tutorcruise.db.dao.model.InstituteProfile;
import com.nervytech.tutorcruise.db.service.interfaces.IInstituteProfileService;
import com.nervytech.tutorcruise.service.exception.TrainerCruiseServiceException;

@Service("instituteProfileService")
public class InstituteProfileService implements IInstituteProfileService {

	@Autowired
	private IInstituteProfileDAO instituteProfileDao;

	public void saveInstituteProfile(InstituteProfile instituteprofile) {
	}

	public InstituteProfile getInstituteProfile(long userId)
			throws TrainerCruiseServiceException {
		InstituteProfile instProfile = null;
		List list = null;
		try {
			list = instituteProfileDao.getInstituteProfile(userId);
			if (list.size() > 0)
				instProfile = (InstituteProfile) list.get(0);
		} catch (Exception e) {
			e.printStackTrace();
			throw new TrainerCruiseServiceException(e.getMessage());
		}
		return instProfile;
	}

	public void updateInstituteProfile(InstituteProfile instituteprofile) {
	}

	public void updateFirstLogin(long userId, String phone, String website,
			String address) throws TrainerCruiseServiceException {
		try {
			instituteProfileDao.updateFirstLogin(userId, phone, website,
					address);
		} catch (Exception e) {
			throw new TrainerCruiseServiceException(e.getMessage());
		}
	}

}
